#define _CRT_SECURE_NO_WARNINGS 1
int multiply(int A, int B) {
    if (A == 1)
    {
        return B;
    }
    int a = A >> 1;
    if ((A & 1) == 0)
    {
        return multiply(a, B) + multiply(a, B);
    }
    return multiply(a, B) + multiply(a, B) + B;
}